<?php
	class CustomerMgr
	{
		private $dbc;
		
		 public function __construct($dbc = null)
	     {
	            if (isset($dbc))
	            {
	                $this->dbc = $dbc;
	            }
	     }
	     
	     public function addCustomer($email,$firstname,$lastname,$add1,$add2,$city,$state,$pin,$phone) 
	     {
	     	$q="INSERT INTO customer VALUES (NULL, '$email', '$firstname', '$lastname', '$add1', '$add2', '$city', '$state', $pin, $phone, NOW())";
			$r = mysqli_query($this->dbc, $q);
			// For debugging purposes:
			//if (!$r) echo mysqli_error($dbc);	
			$id=mysqli_insert_id($this->dbc);
			return $id;
	     }
	}  